package com.ruoyi.system.domain;

import java.util.Date;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * MBTI测试记录对象 mbti_test_record
 * 
 * @author ruoyi
 * @date 2025-01-21
 */
public class MbtiTestRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 测试记录ID */
    @Excel(name = "测试记录ID", cellType = ColumnType.NUMERIC)
    private Long recordId;

    /** 测试类型ID */
    @Excel(name = "测试类型ID", cellType = ColumnType.NUMERIC)
    @NotNull(message = "测试类型ID不能为空")
    private Long testTypeId;

    /** 用户ID */
    @Excel(name = "用户ID", cellType = ColumnType.NUMERIC)
    private Long userId;

    /** 用户姓名 */
    @Excel(name = "用户姓名")
    @Size(min = 0, max = 100, message = "用户姓名不能超过100个字符")
    private String userName;

    /** 用户邮箱 */
    @Excel(name = "用户邮箱")
    @Size(min = 0, max = 100, message = "用户邮箱不能超过100个字符")
    private String userEmail;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "开始时间不能为空")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /** 用时(秒) */
    @Excel(name = "用时(秒)", cellType = ColumnType.NUMERIC)
    private Integer duration;

    /** 状态（0进行中 1已完成 2已放弃） */
    @Excel(name = "状态", readConverterExp = "0=进行中,1=已完成,2=已放弃")
    private String status;

    /** IP地址 */
    @Excel(name = "IP地址")
    @Size(min = 0, max = 50, message = "IP地址不能超过50个字符")
    private String ipAddress;

    /** 用户代理 */
    @Size(min = 0, max = 500, message = "用户代理不能超过500个字符")
    private String userAgent;

    public void setRecordId(Long recordId) 
    {
        this.recordId = recordId;
    }

    public Long getRecordId() 
    {
        return recordId;
    }

    public void setTestTypeId(Long testTypeId) 
    {
        this.testTypeId = testTypeId;
    }

    public Long getTestTypeId() 
    {
        return testTypeId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    public String getUserName() 
    {
        return userName;
    }

    public void setUserEmail(String userEmail) 
    {
        this.userEmail = userEmail;
    }

    public String getUserEmail() 
    {
        return userEmail;
    }

    public void setStartTime(Date startTime) 
    {
        this.startTime = startTime;
    }

    public Date getStartTime() 
    {
        return startTime;
    }

    public void setEndTime(Date endTime) 
    {
        this.endTime = endTime;
    }

    public Date getEndTime() 
    {
        return endTime;
    }

    public void setDuration(Integer duration) 
    {
        this.duration = duration;
    }

    public Integer getDuration() 
    {
        return duration;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setIpAddress(String ipAddress) 
    {
        this.ipAddress = ipAddress;
    }

    public String getIpAddress() 
    {
        return ipAddress;
    }

    public void setUserAgent(String userAgent) 
    {
        this.userAgent = userAgent;
    }

    public String getUserAgent() 
    {
        return userAgent;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("recordId", getRecordId())
            .append("testTypeId", getTestTypeId())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("userEmail", getUserEmail())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("duration", getDuration())
            .append("status", getStatus())
            .append("ipAddress", getIpAddress())
            .append("userAgent", getUserAgent())
            .append("createTime", getCreateTime())
            .toString();
    }
}
